const loader =new Worker(require('./canvas.ts'));

export  class WorkerObj {
    loader=loader;
    constructor() {
        loader.onmessage=this.onmessage;
    };
    postMessage(val){
        this.loader.postMessage(val);
    }
    onmessage(val){
        this.loader.onmessage({
            ...val
        })
    }
    terminate(){
        this.loader.terminate()
    }
}